package com.dcy.decorator.mydecorator;

import com.dcy.decorator.Drink;

/**
 * @Author：dcy
 * @Description:
 * @Date: 2021/1/22 8:33
 */
public class Decorator extends Drink {

    private Drink drink;

    public Decorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public float cost() {
        // getPrice 自己的价格
        return super.getPrice() + drink.cost();
    }

    @Override
    public String getDes() {
        return super.getDes() + "" + super.getPrice() + " && " + drink.getDes();
    }
}
